package org.hsieh.tr.explore.dbsource;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * 
 *@author hsieh 234aini@gmail.com
 * 
 */
public final class DatabaseInfoManager {

    public final static DatabaseInfoManager INSTANCE = new DatabaseInfoManager();

    private DatabaseInfoManager() {
    }

    private List<IDatabaseInfo> infos = new ArrayList<IDatabaseInfo>();

    public List<IDatabaseInfo> getInfos() {
	return infos;
    }

    public void addDatabaseInfo(IDatabaseInfo info) {
	if (!infos.contains(info)) {
	    infos.add(info);
	}
    }

    public void removeDatabaseInfo(IDatabaseInfo info) {
	if (infos.remove(info)) {
	}
    }

    public void addInfos(List<IDatabaseInfo> infos) {
	if (infos != null)
	    this.infos.addAll(infos);
    }

}
